import React,{useState} from 'react'

function UseState(){
    console.log('start')
    // 格式：const [state,setState] = useState(default)
    const [qty,setQty] = useState(1)

    console.log('qty',qty)

    console.log('end')
    return (
        <div>
            <h4>useState</h4>
            <button onClick={()=>{
                setQty(qty+1)
            }}>qty: {qty}</button>
        </div>
    )
}

export default UseState;